<!doctype html>
<html>
<head>
    <title>统计网上页面</title>
    <?php $this->load->module('admin/index/page_header');?>
    <link href="<?php echo URLPRE;?>static/admin/css/font_icon.css" rel="stylesheet" />
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/Kalendajs/build/kalendae.standalone.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/Kalendajs/build/kalendae.css" rel="stylesheet" />
	<script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2.min.js"></script>
    <script type="text/javascript" src="<?php echo URLPRE;?>static/public/Lib/select2/select2_locale_zh-CN.js"></script>
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2.css" rel="stylesheet" />
    <link href="<?php echo URLPRE;?>static/public/Lib/select2/select2-bootstrap.css" rel="stylesheet" />
</head>
<body>
<div class="wrap J_check_wrap">
    <form method="post" action="<?php echo $index_url?>">
        <div class="table_list" id="content">
            <div class="h_a">分销统计  <span class="fr">注:导出Excel功能单次最多可导出1000条数据</span></div>
            <table width="100%">
                <tbody>
                <tr>
                    <td>
                        供应商 <select id="supplier" name="supplier_id" style=" width:230px">
                                 <option></option>
                                <?php echo $suppliers;?>
                            </select>&nbsp;&nbsp;
                        线路 <input type="text" value="<?php echo $condition['line']?>" placeholder="线路编号/名称" name="line" class="input rounded" size="20" />
                        收款 <select name="pay_status">
                        <option value="0">全部</option>
                        <option value="1" <?php if($condition['pay_status']==1) echo 'selected'?>>未收款</option>
                        <option value="3" <?php if($condition['pay_status']==3) echo 'selected'?>>已收款</option>
                    </select>&nbsp;&nbsp;
                        下单日 <input type="text" value="<?php echo $condition['start_add']?>" placeholder="下单日" class="input rounded" name="start_add" id="Kalendae3" />~
                        <input type="text" value="<?php echo $condition['end_add']?>" placeholder="下单日" class="input rounded" name="end_add" id="Kalendae4" /></td>
                </tr>
                <tr>
                	<td>
                        分销商 <input type="text" value="<?php echo $condition['admin_user_name']?>" placeholder="分销商" name="admin_user_name" class="input rounded" size="20" />
                        订单编号 <input type="text" value="<?php echo $condition['order_sn']?>" placeholder="订单编号" name="order_sn" class="input rounded" size="20" />&nbsp;&nbsp;
                        打款 <select name="finacial_status">
                            <option value="0">全部</option>
                            <option value="1" <?php if($condition['finacial_status']==1) echo 'selected'?>>未打款</option>
                            <option value="2" <?php if($condition['finacial_status']==2) echo 'selected'?>>打款未审核</option>
                            <option value="3" <?php if($condition['finacial_status']==3) echo 'selected'?>>已结款</option>
                        </select>
                        团期 <input type="text" value="<?php echo $condition['start_date']?>" placeholder="团期" class="input rounded" name="start_date" id="Kalendae" />~<input type="text" value="<?php echo $condition['end_date']?>" placeholder="团期" class="input rounded" name="end_date" id="Kalendae2" />
                        &nbsp;&nbsp;<input type="submit" class="btn" value="搜索">&nbsp;&nbsp;<a href="<?php echo site_url('order/order/download'.$query_str)?>">导出Excel</a>
                    </td>
                </tr>
                </tbody>
            </table>
            <table cellpadding="1" cellspacing="0" border="1" width="100%">
                <tr>
                    <td width="30">序号</td>
                    <td width="60">发团日期</td>
                    <td width="140">线路信息</td>
                    <td width="70">供应商</td>
                    <td width="100">订单编号</td>
                    <td width="70">发团人数</td>
                    <td width="60">订单总额</td>
                    <td width="60">合同金额</td>
                    <td width="60">分销商</td>
                    <td width="40">是否收款</td>
                    <td width="60">供应商结款</td>
                    <td width="60">合同</td>
                </tr>
                <?php if($list):?>
                    <tbody>
                    <?php foreach($list as $key=>$val):?>
                        <tr>
                            <td><?php echo $key+1;?></td>
                            <td><?php echo $val['go_date'];?></td>
                            <td><a title="<?php echo $val['line_name']?>"><?php echo sub_str($val['line_name'],0,20)?></a><br><?php echo $val['line_number']?></td>
                            <td><?php echo $val['supplier_name']?></td>
                            <td><?php echo $val['order_sn'];?></td>
                            <td class="total_num">
                                <?php foreach($val['price_cate'] as $p):?>
                                <?php if($p['num']){echo $p['price_name'].'&nbsp;X&nbsp;'.$p['num'].'<br>';}?>
								<?php endforeach;?>
                            </td>
                            <td><?php echo $val['order_account'];?></td>
                            <td><?php echo $val['heji'];?></td>
                            <td><?php echo $val['admin_user_name'];?></td>
                            <td><?php echo ($val['pay_status']==3)?'已支付':'未支付'?></td>
                            <td>
                                <?php if($val['finacial_status']==1):?>
                                未打款
                                <?php elseif($val['finacial_status']==2):?>
                                已打款，未审核
                                <?php else:?>
                                已结款
                                <?php endif;?>
                            </td>
                            <td><?php if($val['heji']):?><a target="_blank" href="<?php echo site_url('order/admin/hetong?id='.$val['order_id'])?>">查看</a><?php endif;?></td>

                            
                        </tr>
                    <?php endforeach;?>
                    <tr>
                        <td>总计</td>
                        <td colspan="5" align="right">成人：<?php echo $total['total_num']-$total['total_num_ch']?>&nbsp;&nbsp;儿童: <?php echo $total['total_num_ch']?></td>
                        <td><?php echo $total['total_account']?></td>
                        <td><?php echo $total['total_heji']?></td>
                        <td colspan="4"></td>

                    </tr>
                    </tbody>
                <?php endif;?>
            </table>
        </div>
    </form>
    <div class="page_nav">
        <?php  echo $this->mypageclass->show(2); ?>
    </div>
</div>
<script type="text/javascript">
$(function(){
	$('#supplier').select2({placeholder: "请选择线路供应商",allowClear: true});
    var kal_dae = new Kalendae.Input('Kalendae', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD',
    });
	var kal_dae2 = new Kalendae.Input('Kalendae2', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD',
    });
    var kal_dae3 = new Kalendae.Input('Kalendae3', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD'
    });
    var kal_dae4 = new Kalendae.Input('Kalendae4', {
        months:1,
        mode:'single',
        format:'YYYY-MM-DD'
    });
	
	$(".total_num").mouseover(function(){
		$(this).find('.jiage').css('display','block');
	});
	$(".total_num").mouseout(function(){
		$(this).find('.jiage').css('display','none');
	});
})
</script>
</body>
</html>